package com.estar.assistsurvy.thread;

import com.estar.assistsurvy.constant.Constants;
import com.estar.assistsurvy.entity.RequestCapture;
import com.estar.assistsurvy.entity.ResponseCapture;

import android.content.Context;
import android.os.Handler;
import android.util.Log;

public class CaptureThread extends BaseThread {
	
	private RequestCapture requestCapture;

	public CaptureThread(Context context, Handler handler, RequestCapture requestCapture) {
		super(context, handler);
		this.requestCapture = requestCapture;
	}
	
	@Override
	public void run() {
		// TODO Auto-generated method stub
		url_str=Constants.CAPTURE_SERVICE;
		json=gson.toJson(requestCapture);
		postRequest(url_str, json);
		Log.i("wl", "抓拍请求返回值"+result);
		if(result!=null){
			ResponseCapture responseCapture=new ResponseCapture();
			responseCapture=gson.fromJson(result, ResponseCapture.class);
			msg.what=0;
			msg.obj=responseCapture;
			msg.sendToTarget();
		}
	}
}
